<template>
	<view class="team-member-item">
		<view class="top-bar">
			<view class="member-level">
				{{detail.customer_type}}
			</view>
			<view class="member-createtime">
				注册时间: {{detail.created_at}}
			</view>
		</view>
		<view class="member-info-wrapper">
			<view class="member-avatar-wrapper">
				<img :src="detail.avatars?detail.avatars:'/static/img/avatar.png'" class="avatar" />
			</view>
			<view class="member-info-main">
				<view class="info-nickname">
					{{detail.phone+'/'+detail.nickname}}
				</view>
				<view class="info-bottom-wrapper">
					<view class="info-item">
						激活量：{{detail.activate_num}}
					</view>
					<view class="info-item">
						交易量：{{detail.trade_amount?detail.trade_amount:0}}
					</view>
					<view class="info-item">
						已邀请：{{detail.invite_num}}
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script lang="ts" setup>
	import { ITeamMember } from './types';
	import { defineProps } from 'vue';


	interface IProps {
		detail : ITeamMember
	}

	const props = withDefaults(defineProps<IProps>(), {
		detail: () => {
			return {
				id: 0, //用户id
				phone: '', //手机号
				nickname: '', //昵称
				trade_amount: null, //交易金额
				avatars: '',
				customer_type: '',
				created_at: '',
				invite_num: 0,
				activate_num: 0,
			}
		}
	})
</script>

<style scoped lang="scss">
	@import "./style.scss";
</style>